from sklearn import svm
from Orange.data import Table
import numpy as np

data = Table("iris2")

model = svm.SVC(C=1.0, kernel='linear')
model.fit(data.X, data.Y)


print(model.dual_coef_)
print(model.support_vectors_)

# 计算法向量  累加(a[i]*y[i]*sv[i])  dual_coef = 累加(a[i]y[i])
x = np.dot(model.dual_coef_ , model.support_vectors_)
print(x[0])
print(model.coef_[0])
